<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
 <head>
  <title>[untitled]</title>
  <link rel="stylesheet" type="text/css" href="../../t/vim_syntax.css" />
 </head>
 <body>

<pre><span class="synKeyword">token</span> postfix<span class="synOperator">:</span><span class="synString">sym</span>[<span class="synDelimiter">'</span><span class="synString">-&gt;</span><span class="synDelimiter">'</span>] () {<span class="synString"> </span>
<span class="synString">    </span><span class="synDelimiter">'</span><span class="synString">-&gt;</span><span class="synDelimiter">'</span>
<span class="synString">    </span><span class="synSpecial">&lt;</span><span class="synSpecialChar">!</span>{ <span class="synIdentifier">$</span><span class="synSpecial">*</span><span class="synIdentifier">QSIGIL</span> }<span class="synSpecial">&gt;</span>
<span class="synString">    </span><span class="synSpecial">[</span>
    <span class="synSpecial">|</span> <span class="synSpecial">&lt;brack=[ [ { ( ]</span><span class="synSpecialChar">&gt;</span> <span class="synSpecial">&lt;</span><span class="synSpecialChar">.</span>obs(<span class="synDelimiter">&quot;</span><span class="synString">'-&gt;</span><span class="synDelimiter">&quot;</span> <span class="synOperator">~</span> <span class="synIdentifier">$</span><span class="synSpecial">&lt;</span><span class="synIdentifier">brack</span><span class="synSpecial">&gt;</span><span class="synOperator">.</span><span class="synType">Str</span> <span class="synOperator">~</span> <span class="synDelimiter">&quot;</span><span class="synString">' as postfix dereferencer</span><span class="synDelimiter">&quot;</span><span class="synOperator">,</span> <span class="synDelimiter">&quot;</span><span class="synString">'.</span><span class="synDelimiter">&quot;</span> <span class="synOperator">~</span> <span class="synIdentifier">$</span><span class="synSpecial">&lt;</span><span class="synIdentifier">brack</span><span class="synSpecial">&gt;</span><span class="synOperator">.</span><span class="synType">Str</span> <span class="synOperator">~</span> <span class="synDelimiter">&quot;</span><span class="synString">' or just '</span><span class="synDelimiter">&quot;</span> <span class="synOperator">~</span> <span class="synIdentifier">$</span><span class="synSpecial">&lt;</span><span class="synIdentifier">brack</span><span class="synSpecial">&gt;</span><span class="synOperator">.</span><span class="synType">Str</span> <span class="synOperator">~</span> <span class="synDelimiter">&quot;</span><span class="synString">' to deref, or whitespace to delimit a pointy block</span><span class="synDelimiter">&quot;</span>)<span class="synSpecial">&gt;</span>
    <span class="synSpecial">|</span> <span class="synSpecial">&lt;</span><span class="synSpecialChar">.</span>obs(<span class="synDelimiter">'</span><span class="synString">-&gt; as postfix</span><span class="synDelimiter">'</span><span class="synOperator">,</span> <span class="synDelimiter">'</span><span class="synString">either . to call a method, or whitespace to delimit a pointy block</span><span class="synDelimiter">'</span>)<span class="synSpecial">&gt;</span>
    <span class="synSpecial">]</span>
}

<span class="synKeyword">token</span> sibble (<span class="synIdentifier">$l</span><span class="synOperator">,</span> <span class="synIdentifier">$lang2</span>) {
<span class="synString">    </span><span class="synOperator">:</span><span class="synSpecial">my</span> (<span class="synIdentifier">$lang</span><span class="synOperator">,</span> <span class="synIdentifier">$start</span><span class="synOperator">,</span> <span class="synIdentifier">$stop</span>)<span class="synOperator">;</span>
<span class="synString">    </span><span class="synSpecial">&lt;</span>babble(<span class="synIdentifier">$l</span>)<span class="synSpecial">&gt;</span>
<span class="synString">    </span>{ <span class="synSpecial">my</span> <span class="synIdentifier">$B</span> <span class="synOperator">=</span> <span class="synIdentifier">$</span><span class="synSpecial">&lt;</span><span class="synIdentifier">babble</span><span class="synSpecial">&gt;</span><span class="synDelimiter">&lt;</span><span class="synString">B</span><span class="synDelimiter">&gt;</span><span class="synOperator">;</span> (<span class="synIdentifier">$lang</span><span class="synOperator">,</span><span class="synIdentifier">$start</span><span class="synOperator">,</span><span class="synIdentifier">$stop</span>) <span class="synOperator">=</span> <span class="synIdentifier">@$B</span><span class="synOperator">;</span> }

<span class="synString">    </span><span class="synIdentifier">$start</span><span class="synString"> </span><span class="synSpecial">&lt;left=</span><span class="synSpecialChar">.</span>nibble(<span class="synIdentifier">$lang</span>)<span class="synSpecial">&gt;</span><span class="synString"> </span><span class="synSpecial">[</span> <span class="synIdentifier">$stop</span> <span class="synSpecial">||</span> <span class="synSpecial">&lt;</span><span class="synSpecialChar">.</span>panic<span class="synOperator">:</span> <span class="synDelimiter">&quot;</span><span class="synString">Couldn't find terminator </span><span class="synIdentifier">$stop</span><span class="synDelimiter">&quot;</span><span class="synSpecial">&gt;</span> <span class="synSpecial">]</span>
<span class="synString">    </span><span class="synSpecial">[</span> <span class="synSpecial">&lt;?</span>{ <span class="synIdentifier">$start</span> <span class="synOperator">ne</span> <span class="synIdentifier">$stop</span> }<span class="synSpecial">&gt;</span>
        <span class="synSpecial">&lt;</span><span class="synSpecialChar">.</span>ws<span class="synSpecial">&gt;</span>
        <span class="synSpecial">[</span> <span class="synSpecial">&lt;?[</span><span class="synString"> [ { ( &lt; </span><span class="synSpecial">]&gt;</span> <span class="synSpecial">&lt;</span><span class="synSpecialChar">.</span>obs(<span class="synDelimiter">'</span><span class="synString">brackets around replacement</span><span class="synDelimiter">'</span><span class="synOperator">,</span> <span class="synDelimiter">'</span><span class="synString">assignment syntax</span><span class="synDelimiter">'</span>)<span class="synSpecial">&gt;</span> <span class="synSpecial">]</span><span class="synSpecialChar">?</span>
        <span class="synSpecial">[</span> <span class="synSpecial">&lt;</span>infixish<span class="synSpecial">&gt;</span> <span class="synSpecial">||</span> <span class="synSpecial">&lt;</span>panic<span class="synOperator">:</span> <span class="synDelimiter">&quot;</span><span class="synString">Missing assignment operator</span><span class="synDelimiter">&quot;</span><span class="synSpecial">&gt;</span> <span class="synSpecial">]</span>
        <span class="synSpecial">[</span> <span class="synSpecial">&lt;?</span>{ <span class="synIdentifier">$</span><span class="synSpecial">&lt;</span><span class="synIdentifier">infixish</span><span class="synSpecial">&gt;</span><span class="synOperator">.</span><span class="synType">Str</span> <span class="synOperator">eq</span> <span class="synDelimiter">'</span><span class="synString">=</span><span class="synDelimiter">'</span> <span class="synOperator">||</span> <span class="synIdentifier">$</span><span class="synSpecial">&lt;</span><span class="synIdentifier">infixish</span><span class="synSpecial">&gt;</span><span class="synOperator">.</span><span class="synDelimiter">&lt;</span><span class="synString">infix_postfix_meta_operator</span><span class="synDelimiter">&gt;</span>[<span class="synNumber">0</span>] }<span class="synSpecial">&gt;</span> <span class="synSpecial">||</span> <span class="synSpecial">&lt;</span><span class="synSpecialChar">.</span>panic<span class="synOperator">:</span> <span class="synDelimiter">&quot;</span><span class="synString">Malformed assignment operator</span><span class="synDelimiter">&quot;</span><span class="synSpecial">&gt;</span> <span class="synSpecial">]</span>
        <span class="synSpecial">&lt;</span><span class="synSpecialChar">.</span>ws<span class="synSpecial">&gt;</span>
        <span class="synSpecial">[</span> <span class="synSpecial">&lt;right=</span>EXPR(<span class="synOperator">item</span> <span class="synIdentifier">%item_assignment</span>)<span class="synSpecial">&gt;</span> <span class="synSpecial">||</span> <span class="synSpecial">&lt;</span><span class="synSpecialChar">.</span>panic<span class="synOperator">:</span> <span class="synDelimiter">&quot;</span><span class="synString">Assignment operator missing its expression</span><span class="synDelimiter">&quot;</span><span class="synSpecial">&gt;</span> <span class="synSpecial">]</span>
    <span class="synSpecial">||</span><span class="synSpecialChar">.</span>
        { <span class="synIdentifier">$lang</span> <span class="synOperator">=</span> <span class="synIdentifier">$lang2</span><span class="synOperator">.</span>unbalanced(<span class="synIdentifier">$stop</span>)<span class="synOperator">;</span> }
        <span class="synSpecial">&lt;right=</span><span class="synSpecialChar">.</span>nibble(<span class="synIdentifier">$lang</span>)<span class="synSpecial">&gt;</span> <span class="synIdentifier">$stop</span> <span class="synSpecial">||</span> <span class="synSpecial">&lt;</span><span class="synSpecialChar">.</span>panic<span class="synOperator">:</span> <span class="synDelimiter">&quot;</span><span class="synString">Malformed replacement part; couldn't find final </span><span class="synIdentifier">$stop</span><span class="synDelimiter">&quot;</span><span class="synSpecial">&gt;</span>
    <span class="synSpecial">]</span>
}

<span class="synKeyword">token</span> TOP {
<span class="synString">    </span><span class="synSpecial">&lt;</span>fred(<span class="synNumber">1</span>)<span class="synSpecial">&gt;</span>
<span class="synString">    </span><span class="synSpecial">&lt;</span>fred<span class="synOperator">:</span> <span class="synNumber">2</span><span class="synOperator">,</span> <span class="synNumber">3</span><span class="synSpecial">&gt;</span>
}

ok(<span class="synDelimiter">'</span><span class="synString">aaab</span><span class="synDelimiter">'</span> <span class="synOperator">~~</span> <span class="synDelimiter">/</span><span class="synString"> </span><span class="synDelimiter">&quot;</span><span class="synIdentifier">$</span><span class="synSpecial">!</span><span class="synIdentifier">pattern</span><span class="synDelimiter">&quot;</span><span class="synString"> </span><span class="synDelimiter">/</span><span class="synOperator">,</span> <span class="synDelimiter">'</span><span class="synString">Interpolation of instance member</span><span class="synDelimiter">'</span>)<span class="synOperator">;</span>
ok(<span class="synDelimiter">&quot;</span><span class="synSpecial">\x[</span><span class="synSpecialChar">c</span><span class="synSpecial">]\x[</span><span class="synSpecialChar">a</span><span class="synSpecial">]</span><span class="synDelimiter">&quot;</span> <span class="synOperator">~~</span> <span class="synDelimiter">m/</span><span class="synSpecial">&lt;[\c[</span><span class="synSpecialChar">FORM FEED (FF), LINE FEED (LF)</span><span class="synSpecial">]]&gt;</span><span class="synDelimiter">/</span><span class="synOperator">,</span> <span class="synDelimiter">'</span><span class="synString">Charclass multiple FORM FEED (FF), LINE FEED (LF)</span><span class="synDelimiter">'</span>)<span class="synOperator">;</span>
is(<span class="synDelimiter">'</span><span class="synString">aaaaa</span><span class="synDelimiter">'</span> <span class="synOperator">~~</span> <span class="synDelimiter">/</span><span class="synSpecial">&lt;	</span><span class="synString">a aa aaaa</span><span class="synSpecial"> &gt;</span><span class="synDelimiter">/</span><span class="synOperator">,</span> <span class="synDelimiter">'</span><span class="synString">aaaa</span><span class="synDelimiter">'</span><span class="synOperator">,</span> <span class="synDelimiter">'</span><span class="synString">leading whitespace quotes words (tab)</span><span class="synDelimiter">'</span>)<span class="synOperator">;</span>

<span class="synComment">#ok(&quot;\c[DIGIT ZERO]&quot; ~~ m/^&lt;:bc&lt;EN&gt;&gt;$/, q{Match (European Number)} );</span>
<span class="synComment">#ok(&quot;abc&quot; ~~ m/a(bc){$0 = uc $0}/, 'Numeric match');</span>
<span class="synComment">#ok(&quot;abc&quot; ~~ m/a(bc){make uc $0}/ , 'Zero match');</span>
<span class="synComment">#'whatever' ~~ /w &lt;test complicated . regex '&lt;goes here&gt;'&gt;/;</span>
<span class="synComment">#is('foo456bar' ~~ /foo &lt;(\d+ bar/, '456bar', '&lt;( match');</span>
<span class="synComment">#is('foo123bar' ~~ /foo &lt;( bar || ....../, 'foo123', '&lt;( in backtracking');</span>
<span class="synComment">#is('foo123bar' ~~ /foo &lt;( 123 [ &lt;( xyz ]?/, '123', 'multiple &lt;( backtracking');</span>
<span class="synComment">#ok(!( &quot;a&quot; ~~ m/(&lt;[a..z]-[aeiou]&gt;)/ ), 'Difference set failure');</span>
<span class="synComment">#ok(!('a0' ~~ m/$aref[0]/), 'Array ref stringifies before matching'); #OK</span>
<span class="synComment">#ok(!( &quot;abcd f&quot; ~~ m/abc &lt;!before d &lt;.ws&gt; f&gt;/ ), 'Negative lookahead failure');</span>

<span class="synComment"># vim: ft=perl6</span>
</pre>

 </body>
</html>
